<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      * {
        padding: 0;
        margin: 0;
      }
      #cat {
        position: absolute;
        top: 0;
        left: 0;
        width: 200px;
        height: 200px;
      }
    </style>
  </head>
  <body>
    <img src="./img/longmao.webp" alt="" id="cat" />

    <script>
      var Cat = document.getElementById('cat');
      document.onmousemove = function (event) {
        console.log(event.clientX);
        var X = event.clientX;
        var Y = event.clientY;
        Cat.style.left = X - 100 + 'px';
        Cat.style.top = Y - 100 + 'px';
      };
    </script>
  </body>
</html>
